package com.ambow.core.service.impl;

import com.ambow.core.po.DqDeveloper;
import com.ambow.core.mapper.DqDeveloperMapper;
import com.ambow.core.service.DqDeveloperService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 开发者表 服务实现类
 * </p>
 *
 * @author dq
 * @since 2022-09-05
 */
@Service
public class DqDeveloperServiceImpl extends ServiceImpl<DqDeveloperMapper, DqDeveloper> implements DqDeveloperService {

    @Autowired
    private DqDeveloperMapper dqDeveloperMapper;
    @Override
    public int join(DqDeveloper developer) {
        return dqDeveloperMapper.join(developer.getRoleId());
    }

    @Override
    public boolean findDeveloperStaticByid(Integer id) {
        QueryWrapper<DqDeveloper> wrapper = new QueryWrapper<>();
        wrapper.eq("role_id",id);
        DqDeveloper developer = dqDeveloperMapper.selectOne(wrapper);
        if(developer.getDeveloperStatic()==1){
            return true;
        }else {
            return false;
        }
    }


}
